/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.jPanels;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 *
 * @author Gean
 */
@Entity
@Table(name = "movimentacao", catalog = "", schema = "")
@NamedQueries({
    @NamedQuery(name = "Movimentacao.findAll", query = "SELECT m FROM Movimentacao m"),
    @NamedQuery(name = "Movimentacao.findByIdMovimentacao", query = "SELECT m FROM Movimentacao m WHERE m.idMovimentacao = :idMovimentacao"),
    @NamedQuery(name = "Movimentacao.findByDtInicio", query = "SELECT m FROM Movimentacao m WHERE m.dtInicio = :dtInicio"),
    @NamedQuery(name = "Movimentacao.findByDtTermino", query = "SELECT m FROM Movimentacao m WHERE m.dtTermino = :dtTermino"),
    @NamedQuery(name = "Movimentacao.findByTermo", query = "SELECT m FROM Movimentacao m WHERE m.termo = :termo"),
    @NamedQuery(name = "Movimentacao.findBySituacaoMov", query = "SELECT m FROM Movimentacao m WHERE m.situacaoMov = :situacaoMov"),
    @NamedQuery(name = "Movimentacao.findByIdBemPatrimonial", query = "SELECT m FROM Movimentacao m WHERE m.idBemPatrimonial = :idBemPatrimonial"),
    @NamedQuery(name = "Movimentacao.findByResponsavelOrigem", query = "SELECT m FROM Movimentacao m WHERE m.responsavelOrigem = :responsavelOrigem"),
    @NamedQuery(name = "Movimentacao.findByResponsavelDestino", query = "SELECT m FROM Movimentacao m WHERE m.responsavelDestino = :responsavelDestino"),
    @NamedQuery(name = "Movimentacao.findByPredioOrigem", query = "SELECT m FROM Movimentacao m WHERE m.predioOrigem = :predioOrigem"),
    @NamedQuery(name = "Movimentacao.findBySalaOrigem", query = "SELECT m FROM Movimentacao m WHERE m.salaOrigem = :salaOrigem"),
    @NamedQuery(name = "Movimentacao.findByPredioDestino", query = "SELECT m FROM Movimentacao m WHERE m.predioDestino = :predioDestino"),
    @NamedQuery(name = "Movimentacao.findBySalaDestino", query = "SELECT m FROM Movimentacao m WHERE m.salaDestino = :salaDestino")})
public class Movimentacao implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idMovimentacao")
    private Integer idMovimentacao;
    @Basic(optional = false)
    @Column(name = "DtInicio")
    @Temporal(TemporalType.DATE)
    private Date dtInicio;
    @Basic(optional = false)
    @Column(name = "DtTermino")
    @Temporal(TemporalType.DATE)
    private Date dtTermino;
    @Basic(optional = false)
    @Column(name = "Termo")
    private String termo;
    @Basic(optional = false)
    @Column(name = "SituacaoMov")
    private String situacaoMov;
    @Basic(optional = false)
    @Column(name = "idBemPatrimonial")
    private int idBemPatrimonial;
    @Basic(optional = false)
    @Column(name = "ResponsavelOrigem")
    private int responsavelOrigem;
    @Basic(optional = false)
    @Column(name = "ResponsavelDestino")
    private int responsavelDestino;
    @Basic(optional = false)
    @Column(name = "PredioOrigem")
    private int predioOrigem;
    @Basic(optional = false)
    @Column(name = "SalaOrigem")
    private int salaOrigem;
    @Basic(optional = false)
    @Column(name = "PredioDestino")
    private int predioDestino;
    @Basic(optional = false)
    @Column(name = "SalaDestino")
    private int salaDestino;

    public Movimentacao() {
    }

    public Movimentacao(Integer idMovimentacao) {
        this.idMovimentacao = idMovimentacao;
    }

    public Movimentacao(Integer idMovimentacao, Date dtInicio, Date dtTermino, String termo, String situacaoMov, int idBemPatrimonial, int responsavelOrigem, int responsavelDestino, int predioOrigem, int salaOrigem, int predioDestino, int salaDestino) {
        this.idMovimentacao = idMovimentacao;
        this.dtInicio = dtInicio;
        this.dtTermino = dtTermino;
        this.termo = termo;
        this.situacaoMov = situacaoMov;
        this.idBemPatrimonial = idBemPatrimonial;
        this.responsavelOrigem = responsavelOrigem;
        this.responsavelDestino = responsavelDestino;
        this.predioOrigem = predioOrigem;
        this.salaOrigem = salaOrigem;
        this.predioDestino = predioDestino;
        this.salaDestino = salaDestino;
    }

    public Integer getIdMovimentacao() {
        return idMovimentacao;
    }

    public void setIdMovimentacao(Integer idMovimentacao) {
        Integer oldIdMovimentacao = this.idMovimentacao;
        this.idMovimentacao = idMovimentacao;
        changeSupport.firePropertyChange("idMovimentacao", oldIdMovimentacao, idMovimentacao);
    }

    public Date getDtInicio() {
        return dtInicio;
    }

    public void setDtInicio(Date dtInicio) {
        Date oldDtInicio = this.dtInicio;
        this.dtInicio = dtInicio;
        changeSupport.firePropertyChange("dtInicio", oldDtInicio, dtInicio);
    }

    public Date getDtTermino() {
        return dtTermino;
    }

    public void setDtTermino(Date dtTermino) {
        Date oldDtTermino = this.dtTermino;
        this.dtTermino = dtTermino;
        changeSupport.firePropertyChange("dtTermino", oldDtTermino, dtTermino);
    }

    public String getTermo() {
        return termo;
    }

    public void setTermo(String termo) {
        String oldTermo = this.termo;
        this.termo = termo;
        changeSupport.firePropertyChange("termo", oldTermo, termo);
    }

    public String getSituacaoMov() {
        return situacaoMov;
    }

    public void setSituacaoMov(String situacaoMov) {
        String oldSituacaoMov = this.situacaoMov;
        this.situacaoMov = situacaoMov;
        changeSupport.firePropertyChange("situacaoMov", oldSituacaoMov, situacaoMov);
    }

    public int getIdBemPatrimonial() {
        return idBemPatrimonial;
    }

    public void setIdBemPatrimonial(int idBemPatrimonial) {
        int oldIdBemPatrimonial = this.idBemPatrimonial;
        this.idBemPatrimonial = idBemPatrimonial;
        changeSupport.firePropertyChange("idBemPatrimonial", oldIdBemPatrimonial, idBemPatrimonial);
    }

    public int getResponsavelOrigem() {
        return responsavelOrigem;
    }

    public void setResponsavelOrigem(int responsavelOrigem) {
        int oldResponsavelOrigem = this.responsavelOrigem;
        this.responsavelOrigem = responsavelOrigem;
        changeSupport.firePropertyChange("responsavelOrigem", oldResponsavelOrigem, responsavelOrigem);
    }

    public int getResponsavelDestino() {
        return responsavelDestino;
    }

    public void setResponsavelDestino(int responsavelDestino) {
        int oldResponsavelDestino = this.responsavelDestino;
        this.responsavelDestino = responsavelDestino;
        changeSupport.firePropertyChange("responsavelDestino", oldResponsavelDestino, responsavelDestino);
    }

    public int getPredioOrigem() {
        return predioOrigem;
    }

    public void setPredioOrigem(int predioOrigem) {
        int oldPredioOrigem = this.predioOrigem;
        this.predioOrigem = predioOrigem;
        changeSupport.firePropertyChange("predioOrigem", oldPredioOrigem, predioOrigem);
    }

    public int getSalaOrigem() {
        return salaOrigem;
    }

    public void setSalaOrigem(int salaOrigem) {
        int oldSalaOrigem = this.salaOrigem;
        this.salaOrigem = salaOrigem;
        changeSupport.firePropertyChange("salaOrigem", oldSalaOrigem, salaOrigem);
    }

    public int getPredioDestino() {
        return predioDestino;
    }

    public void setPredioDestino(int predioDestino) {
        int oldPredioDestino = this.predioDestino;
        this.predioDestino = predioDestino;
        changeSupport.firePropertyChange("predioDestino", oldPredioDestino, predioDestino);
    }

    public int getSalaDestino() {
        return salaDestino;
    }

    public void setSalaDestino(int salaDestino) {
        int oldSalaDestino = this.salaDestino;
        this.salaDestino = salaDestino;
        changeSupport.firePropertyChange("salaDestino", oldSalaDestino, salaDestino);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMovimentacao != null ? idMovimentacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Movimentacao)) {
            return false;
        }
        Movimentacao other = (Movimentacao) object;
        if ((this.idMovimentacao == null && other.idMovimentacao != null) || (this.idMovimentacao != null && !this.idMovimentacao.equals(other.idMovimentacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.jPanels.Movimentacao[ idMovimentacao=" + idMovimentacao + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
